package com.lagou.lagouserviceuser8181.controller;

import com.lagou.CodeService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class UserController {

    @Reference
    private CodeService codeService;

    @GetMapping("/user")
    public String getUserCode() {
        System.out.println("----------");
        System.out.println("-----进入controller-----");
        String code = codeService.createCode();
        System.out.println("-----获取结果-----：" + code);
        return code;
    }
}
